package com.kin.service.impl;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.kin.dao.User_PermissionMapper;
import com.kin.pojo.User_Permission;
import com.kin.service.IUserPermissionService;


@Service("userPermissionService")
@Transactional
public class UserPermissionService implements IUserPermissionService {

	@Resource
	private User_PermissionMapper user_PermissionDao;//用户私有权限Dao
	
	@Override
	public User_Permission getUserPermissionByUserIdAndPageId(int userid,int pageid) {
		// TODO Auto-generated method stub
		return user_PermissionDao.selectByUserid(userid,pageid);
	}

	@Override
	public int updatePermissionByUserID(int userid,int pageid, int state) {
		// TODO Auto-generated method stub
		return user_PermissionDao.updateByUserId(userid,pageid, state);
	}

	@Override
	public int insertUserPermission(int userid, int pageid, int state) {
		// TODO Auto-generated method stub
		return user_PermissionDao.insertUserPermission(userid, pageid, state);
	}
	
	

}
